// 唯一性校验
$.extend($.fn.validatebox.defaults.rules, {
	existAccount : {
		validator : function(value, param) {
			var flag = true;
			$.ajax({
				url : "identity/user/existAccount.html",
				dataType : "json",
				type : "POST",
				data : "account=" + value,
				async : false,
				success : function(data) {
					flag = data.success;
				}
			});
			return flag;
		},
		message : "用户账号不存在！"
	}
});

function submitForm() {
	$("#fm_chg_pwd").form("submit", {
		url : "identity/user/changePassword.html",
		onSubmit : function() {
			return $(this).form("validate");
		},
		success : function(data) {
			var js = $.parseJSON(data);
			if(js.success){
				$("#fm_chg_pwd").form("clear");
			}
			showMessage(js.msg);
		}
	});
}

function clearForm() {
	$("#fm_chg_pwd").form("clear");
}